@Configuration
public class AppConfig {
    @Bean
    public UserService userService() {
        return new UserServiceImpl();
    }

    @Configuration
    public class AppConfig {
        @Bean(name = "userService")
        public UserService userService() {
            return new UserServiceImpl();
        }
    }

    }
}
